package algorithms.queue;

import org.junit.Test;

public class TestQueue {

	@Test
	public void testq() {
		Queue<Integer> q = new Queue<>(new Node<Integer>(1));

		Node<Integer> node = new Node<>(2);
		Node<Integer> node2 = new Node<>(3);
		node.setNext(node2);
		q.Enqueue(node);
		System.out.println(q);
		System.out.println(q.getHead().getKey());
		System.out.println(q.getTail().getKey());
		System.out.println(q.head());
		System.out.println(q.head());
		System.out.println(q.head());
		System.out.println(q.head());
		q.clear();
		System.out.println(q);
	}

	@Test
	public void testCircularQueue() {
		CircularQueue<Integer> q = new CircularQueue<>(5);
		System.out.println(q.isEmpty());
		q.enque(1);
		q.enque(2);
		q.enque(3);
		q.enque(4);
		q.enque(5);
		q.enque(6);
		System.out.println(q);
		System.out.println(q.deque());
		System.out.println(q);
		q.enque(6);
		System.out.println(q);
		q.enque(7);
		System.out.println(q);
	}
}
